package com.qf.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.qf.base.BaseDao;

import java.io.Serializable;
import java.util.Date;

@TableName("goods")
public class Goods extends BaseDao {


  /**商品名称**/
  @TableField("name")
  private String name;

  /**商户ID**/
  @TableField("merchant_user_id")
  private Long merchantUserId;

  /**商品分类**/
  @TableField("goods_type_id")
  private Long goodsTypeId;

  /**商品主图**/
  @TableField("pic")
  private String pic;

  /**推广说明**/
  @TableField("promote_desc")
  private String promoteDesc;

  /**sku描述**/
  @TableField("sku_title")
  private String skuTitle;

  /**成本**/
  @TableField("sku_cost")
  private String skuCost;

  /**价格**/
  @TableField("sku_price")
  private String skuPrice;

  /**分成**/
  @TableField("sku_pmoney")
  private String skuPmoney;

  /**排序编号**/
  @TableField("order_num")
  private Long orderNum;

  /**是否有效 0 待审核 1 已上架 2 已下架**/
  @TableField("state")
  private Long state;

  /**加入时间**/
  @TableField("create_time")
  private java.util.Date create_time;

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public Long getMerchantUserId() {
    return merchantUserId;
  }

  public void setMerchantUserId(Long merchantUserId) {
    this.merchantUserId = merchantUserId;
  }

  public Long getGoodsTypeId() {
    return goodsTypeId;
  }

  public void setGoodsTypeId(Long goodsTypeId) {
    this.goodsTypeId = goodsTypeId;
  }

  public String getPic() {
    return pic;
  }

  public void setPic(String pic) {
    this.pic = pic;
  }

  public String getPromoteDesc() {
    return promoteDesc;
  }

  public void setPromoteDesc(String promoteDesc) {
    this.promoteDesc = promoteDesc;
  }

  public String getSkuTitle() {
    return skuTitle;
  }

  public void setSkuTitle(String skuTitle) {
    this.skuTitle = skuTitle;
  }

  public String getSkuCost() {
    return skuCost;
  }

  public void setSkuCost(String skuCost) {
    this.skuCost = skuCost;
  }

  public String getSkuPrice() {
    return skuPrice;
  }

  public void setSkuPrice(String skuPrice) {
    this.skuPrice = skuPrice;
  }

  public String getSkuPmoney() {
    return skuPmoney;
  }

  public void setSkuPmoney(String skuPmoney) {
    this.skuPmoney = skuPmoney;
  }

  public Long getOrderNum() {
    return orderNum;
  }

  public void setOrderNum(Long orderNum) {
    this.orderNum = orderNum;
  }

  public Long getState() {
    return state;
  }

  public void setState(Long state) {
    this.state = state;
  }

  public Date getCreate_time() {
    return create_time;
  }

  public void setCreate_time(Date create_time) {
    this.create_time = create_time;
  }

  public enum State{

    UP(1L,"已上架"),
    DOWN(2L,"已下架"),
    AUDIT(0L,"待审核");

    private Long code;
    private String miaoshu;

    State(Long code, String description) {
      this.code = code;
      this.miaoshu = miaoshu;
    }

    public Long getCode() {
      return code;
    }

    public void setCode(Long code) {
      this.code = code;
    }

    public String getMiaoshu() {
      return miaoshu;
    }

    public void setMiaoshu(String miaoshu) {
      this.miaoshu = miaoshu;
    }

    public State get(Long code) {
      for (State state : State.values()) {
        if (state.getCode().equals(code)) {
          return state;
        }
      }
      return null;
    }

    public State get(String miaoshu) {
      for (State state : State.values()) {
        if (state.getMiaoshu().equals(miaoshu)) {
        return state;
        }
      }
      return null;
    }

  }

}
